#include <stdlib.h>
#include <string.h>
#include <tcResource/tc_resource.h>

#define SET_PATH(resource, path) \
	case resource: filename = path; break
#define RESOURCE_ROOT "resources/"

const char* tc_resource_get_path(tcType resource, char *buffer)
{
	const char* filename = NULL;
	strcpy_s(buffer, 128, RESOURCE_ROOT);

	if (resource >= 100)
	{
		strcat_s(buffer, 128, "sound/");
	}

	switch (resource)
	{
		SET_PATH(TC_IMG_BG, "background.png");
		SET_PATH(TC_IMG_CHESSBOARD, "chessboard.png");
		SET_PATH(TC_IMG_DEER, "horse.png");
		SET_PATH(TC_IMG_CRUTCH, "crutch.png");
		SET_PATH(TC_IMG_HAT, "hat.png");
		SET_PATH(TC_IMG_SOCK, "sock.png");
		SET_PATH(TC_IMG_BELL, "bell.png");
		SET_PATH(TC_IMG_SNOW, "snow.png");
		SET_PATH(TC_IMG_HORSE, "horse.png");
		SET_PATH(TC_IMG_LEAF, "leaf.png");
		SET_PATH(TC_IMG_PRESENT, "present.png");
		SET_PATH(TC_IMG_COOKIEMAN, "cookieman.png");
		SET_PATH(TC_IMG_GREEN, "green.png");
		SET_PATH(TC_IMG_RED, "red.png");
		SET_PATH(TC_IMG_GUNSIGHT, "gunsight.png");
		SET_PATH(TC_IMG_HINGE, "hinge.png");
		SET_PATH(TC_IMG_TURNMARK, "turnmark.png");
		SET_PATH(TC_IMG_GAMEOVER, "gameover.png");
		SET_PATH(TC_IMG_STAR, "star.png");

		SET_PATH(TC_IMG_POWERUP, "powerup.png");
		SET_PATH(TC_IMG_FORBID, "forbid.png");
		SET_PATH(TC_IMG_ENLARGE, "enlarge.png");
		SET_PATH(TC_IMG_CHANGE, "change.png");

		SET_PATH(TC_IMG_POWERUP_SHOW, "powerup_show.png");
		SET_PATH(TC_IMG_FORBIT_SHOW, "forbid_show.png");
		SET_PATH(TC_IMG_ENLARGE_SHOW, "enlarge_show.png");
		SET_PATH(TC_IMG_CHANGE_SHOW, "change_show.png");

		SET_PATH(TC_IMG_LOGIN_IMAGE, "login_image.png");
		SET_PATH(TC_IMG_LOGIN_BUTTON, "login_button.png");
		SET_PATH(TC_IMG_EXIT_BUTTON, "exit_button.png");

		SET_PATH(TC_SND_SELECT, "select.wav");
		SET_PATH(TC_SND_HIT_STONE, "hitstone.wav");
		SET_PATH(TC_SND_HIT_HINGE, "hithinge.wav");
		SET_PATH(TC_SND_FIRE, "fire.wav");
		SET_PATH(TC_SND_DROP, "drop.wav");
		SET_PATH(TC_SND_START, "start.wav");
		SET_PATH(TC_SND_MYTURN, "myturn.wav");
		SET_PATH(TC_SND_WIN, "win.wav");
		SET_PATH(TC_SND_LOSE, "lose.wav");
		SET_PATH(TC_SND_POWERUP, "powerup.wav");
		SET_PATH(TC_SND_FORBID, "teleport_ef.wav");
		SET_PATH(TC_SND_ENLARGE, "change.wav");
		SET_PATH(TC_SND_CHANGE, "teleport.wav");
		SET_PATH(TC_SND_CHANGE_EF, "change_ef.wav");

	}
	strcat_s(buffer, 128, filename);
	return buffer;
}